from django.urls import path
from . import views


urlpatterns = [
    # 判断用户名是否重复
    # path('username/<'匹配路由转换器:变量'>/count/', views.UsernameCountView.as_view())
    path('usernames/<username:username>/count/', views.UsernameCountView.as_view()),
    # 用户注册
    path('register/', views.RegisterView.as_view()),
    # 判断手机号是否重复
    path('mobiles/<mobile:mobile>/count/', views.MobileCountView.as_view()),

    # 用户登录
    path('login/', views.LoginView.as_view()),
    # 退出登录  delete http://www.meiduo.site:8080/logout/
    path('logout/', views.LogoutView.as_view()),
    # 判断用户是否登录(用户中心)
    path('info/', views.UserInfoView.as_view()),
    # 修改密码
    path('password/', views.ChangePasswordView.as_view()),
    # 添加邮箱
    path('emails/', views.EmailView.as_view()),
    # 邮箱验证后端逻辑
    path('emails/verification/', views.VerifyEmailView.as_view()),
    # 新增地址
    path('addresses/create/', views.CreateAddressesView.as_view()),
    # 获取登录用户的收货地址
    path('addresses/', views.AddressView.as_view()),
    # 修改put和删除delete地址
    path('addresses/<int:address_id>/', views.UpdateAddressView.as_view()),
    # 设置默认地址PUT
    path('addresses/<int:address_id>/default/', views.DefaultAddressView.as_view()),
    # 修改地址标题PUT
    path('addresses/<int:address_id>/title/', views.UpdateTitleAddress.as_view()),
    # 用户浏览记录：POST /browse_histories/    查询GET  /browse_histories/
    path('browse_histories/', views.UserBrowseHistory.as_view()),
]
